package com.spider.lwlk.mongodb.workplace

import com.gmongo.GMongo

class WorkPlace {

    static main(def args) {

        def mongo = new GMongo('localhost:27017')

        def db = mongo.getDB('test')

//        db.people.insert(name: 'eee', pass: '123654', age: 22, time:  Calendar.getInstance().getTimeInMillis())
//
//        db.people.find().each { println it }
//
//        def time = db.people.findOne(name: 'eee').time
//
//        def cal = Calendar.getInstance()
//
//        cal.setTimeInMillis(time)
//
//        println cal.getTime()

        db."people".find().each { println it }

        db."people_2".insert([ name: 'aa', age: 123, flag: false ])

        println db.people.findOne(name: 'aaaaaaaaaaa')
    }
}
